function initPopupPage(url = 'popup.html', callback) {
    const w = 800;
    const h = 550;
    const left = Math.round((screen.width / 2) - (w / 2));
    const top = Math.round((screen.height / 2) - (h / 2));
    chrome.windows.create({
        url: url,
        width: w,
        height: h,
        focused: true,
        'left': left,
        'top': top,
        type: 'popup'
    }, callback);
}

function browserActionCallback() {
    initPopupPage('popup.html', (win) => {
        console.log(win)
    });
}

chrome.browserAction.onClicked.addListener(browserActionCallback);
